/**
 * output package name
 */
package com.kingdee.eas.custom.jiu.statement;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.apache.log4j.Logger;

import com.kingdee.bos.ctrl.swing.event.SelectorEvent;
import com.kingdee.bos.ctrl.swing.event.SelectorListener;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.metadata.entity.FilterInfo;
import com.kingdee.bos.metadata.entity.FilterItemInfo;
import com.kingdee.bos.ui.face.CoreUIObject;
import com.kingdee.eas.basedata.assistant.ProjectInfo;
import com.kingdee.eas.basedata.org.CtrlUnitInfo;
import com.kingdee.eas.common.client.SysContext;
import com.kingdee.eas.custom.basedata.client.GeneraProjectMultiListUI;
import com.kingdee.eas.util.client.MsgBox;

/**
 * output class name
 */
public class BudgetDetailsFilterUI extends AbstractBudgetDetailsFilterUI
{
    private static final Logger logger = CoreUIObject.getLogger(BudgetDetailsFilterUI.class);
    
    @Override
    public void onLoad() throws Exception {   	
    	super.onLoad();
    	
    	//项目左树右表
    	GeneraProjectMultiListUI selector = new GeneraProjectMultiListUI(this);
		project.setSelector(selector);
		project.setEnabledMultiSelection(true);
		project.setEditFormat("$number$");
		project.setDisplayFormat("$name$");
		project.setCommitFormat("$number$");
    	
    	CtrlUnitInfo  company= SysContext.getSysContext().getCurrentCtrlUnit();//获取当前管理单元CU ,比财务组织'成本中心更上一级  	
		String companyId = company.getId().toString(); //当前组织ID
		
		EntityViewInfo view = new EntityViewInfo(); 
		FilterInfo filter = new FilterInfo();
		filter.getFilterItems().add(new FilterItemInfo("cu.id", companyId));
		view.setFilter(filter);
		project.setEntityViewInfo(view);
    	
		
    }   
    Object data = null;
    @Override
    protected void project_willShow(SelectorEvent e) throws Exception {
    	super.project_willShow(e);
    	  data = project.getData();
    	  
    	  GeneraProjectMultiListUI selector = new GeneraProjectMultiListUI(this,data);
  		  project.setSelector(selector);
 
    }
    
    
    
    
	/**
	 * 自定义用户查询UI
	 * 获取输入框中的值进行查询
	 */
	// 获取条件用户UI的文本框中的值放到filter中并返回
	public FilterInfo getFilterInfo() {

		FilterInfo filter = super.getFilterInfo();
			
		return filter;
	}
    
    /**
     * output class constructor
     */
    public BudgetDetailsFilterUI() throws Exception
    {
        super();
    }

    /**
     * output storeFields method
     */
    public void storeFields()
    {
        super.storeFields();
    }

}